 #ifndef __DFA__

#define __DFA__

#include"fa.h"
#include<map>
#include<set>
#include<string>

class NFA;

using std::set;
using std::string;
using std::map;

typedef std::pair<unsigned, char> lefton;

class DFA : public FA {

     std::map<lefton, unsigned> rules;
     unsigned starting;
     std::set<unsigned> accepting;
     
     public:
     
     DFA();
     DFA(DFA const &);
     ~DFA();
     
     std::set<unsigned> allStates() const;
     unsigned feedTerminal(unsigned, char) const;
     std::set<unsigned> feedTerminal(std::set<unsigned> const &, char) const;
     unsigned feedString(unsigned, std::string const &) const;
     std::set<unsigned> feedString(std::set<unsigned> const &, std::string const &) const; 
     unsigned startingState() const;
     std::set<unsigned> const & acceptingStates() const;     
     bool isAccepting(unsigned) const;
     bool isAccepting(std::set<unsigned> const &) const;
     bool isEmpty() const;

	std::set<char> getAlphabet() const;
	set < set < unsigned >,  CompareSet > partition() const;
	DFA mimimize() const;

     DFA & operator= (DFA const &);
     DFA & operator|= (DFA const &);
     DFA & operator&= (DFA const &);
     DFA & operator+= (DFA const &);
     bool operator== (DFA const &) const;
     DFA operator! () const;
     DFA operator| (DFA const &) const;
     DFA operator& (DFA const &) const;
     DFA operator+ (DFA const &) const;
     DFA operator* () const;
     
     friend std::istream & operator>>(std::istream &, DFA &);
     friend std::ostream & operator<<(std::ostream &, DFA const &);
     friend class NFA;
	
};

#endif
